#include<bits/stdc++.h>
using namespace std;
int n,x,fr[1050000];
double h[1050000],r[1050000],R[1050000],dp[1050000],ans;
double dis(int x,int y) {
    if (r[y]>=R[x]) return h[x];
    if (R[y]<=r[x]) return 0;
    if ((R[y]-r[y])/h[y]<=(R[x]-r[x])/h[x]) {
        if (r[y]<=r[x]) return 0;
        return h[x]*(r[y]-r[x])/(R[x]-r[x]);
    }
    if (R[y]>=R[x]) {
        return max(h[x]-h[y]*(R[x]-r[y])/(R[y]-r[y]),0.0);
    }
    return max(h[x]*(R[y]-r[x])/(R[x]-r[x])-h[y],0.0);
}
int main() {
    freopen("wan.in","r",stdin);
    freopen("wan.out","w",stdout);
    scanf("%d",&n);
    for (int i=1;i<=n;i++) {
        scanf("%d",&x);
        h[i]=x;
        scanf("%d",&x);
        r[i]=x;
        scanf("%d",&x);
        R[i]=x;
    }
    ans=h[1];
    for (int i=2;i<=n;i++) {
        for (int j=i-1;j>=max(i-50,1);j--) {
            if (dp[j]+dis(j,i)>dp[i]) {
                dp[i]=dp[j]+dis(j,i);
                fr[i]=j;
            }
            if (fr[j]) {
                if (dp[fr[j]]+dis(fr[j],i)>dp[i]) {
                    dp[i]=dp[fr[j]]+dis(fr[j],i);
                    fr[i]=fr[j];
                }
            }
        }
        ans=max(ans,dp[i]+h[i]);
    }
    cout<<fixed<<setprecision(12)<<ans<<endl;
    return 0;
}

